home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / AFFS_FS.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  4KB  |  116 lines

  1. #ifndef _AFFS_FS_H
  2. #define _AFFS_FS_H
  3. /*
  4.  * The affs filesystem constants/structures
  5.  */
  6.  
  7. #include <linux/types.h>
  8.  
  9. #define AFFS_SUPER_MAGIC 0xadff
  10.  
  11. /* Get the filesystem block size given an inode. */
  12. #define AFFS_I2BSIZE(inode) ((inode)->i_sb->s_blocksize)
  13.  
  14. /* Get the filesystem hash table size given an inode. */
  15. #define AFFS_I2HSIZE(inode) ((inode)->i_sb->u.affs_sb.s_hashsize)
  16.  
  17. /* Get the block number bits given an inode */
  18. #define AFFS_I2BITS(inode) ((inode)->i_sb->s_blocksize_bits)
  19.  
  20. /* Get the fs type given an inode */
  21. #define AFFS_I2FSTYPE(inode) ((inode)->i_sb->u.affs_sb.s_flags & SF_INTL)
  22.  
  23. struct DateStamp
  24. {
  25.   u32 ds_Days;
  26.   u32 ds_Minute;
  27.   u32 ds_Tick;
  28. };
  29.  
  30. /* --- Prototypes -----------------------------------------------------------------------------    */
  31.  
  32. /* amigaffs.c */
  33.  
  34. extern int    affs_get_key_entry(int bsize, void *data, int entry_pos);
  35. extern int    affs_get_file_name(int bsize, void *fh_data, unsigned char **name);
  36. extern u32    affs_checksum_block(int bsize, void *data, s32 *ptype, s32 *stype);
  37. extern void    affs_fix_checksum(int bsize, void *data, int cspos);
  38. extern void    secs_to_datestamp(time_t secs, struct DateStamp *ds);
  39. extern int    prot_to_mode(unsigned int prot);
  40. extern u32    mode_to_prot(int mode);
  41. extern int    affs_insert_hash(unsigned long dir_ino, struct buffer_head *header,
  42.             struct inode *inode);
  43. extern int    affs_remove_hash(struct buffer_head *bh, struct inode *inode);
  44. extern int    affs_remove_link(struct buffer_head *bh, struct inode *inode);
  45. extern int    affs_remove_header(struct buffer_head *bh, struct inode *inode);
  46. extern void    affs_error(struct super_block *sb, const char *function, const char *fmt, ...);
  47. extern void    affs_warning(struct super_block *sb, const char *function, const char *fmt, ...);
  48. extern int    affs_check_name(const unsigned char *name, int len);
  49. extern int    affs_copy_name(unsigned char *bstr, const unsigned char *name);
  50.  
  51. /* bitmap. c */
  52.  
  53. extern int    affs_count_free_blocks(struct super_block *s);
  54. extern int    affs_count_free_bits(int blocksize, const char *data);
  55. extern void    affs_free_block(struct super_block *sb, s32 block);
  56. extern s32    affs_new_header(struct inode *inode);
  57. extern s32    affs_new_data(struct inode *inode);
  58. extern void    affs_make_zones(struct super_block *sb);
  59.  
  60. /* namei.c */
  61.  
  62. extern int    affs_hash_name(const unsigned char *name, int len, int intl, int hashsize);
  63. extern int    affs_lookup(struct inode *dir, struct dentry *dentry);
  64. extern int    affs_unlink(struct inode *dir, struct dentry *dentry);
  65. extern int    affs_create(struct inode *dir, struct dentry *dentry, int mode);
  66. extern int    affs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
  67. extern int    affs_rmdir(struct inode *dir, struct dentry *dentry);
  68. extern int    affs_link(struct dentry *olddentry, struct inode *dir,
  69.               struct dentry *dentry);
  70. extern int    affs_symlink(struct inode *dir, struct dentry *dentry,
  71.                  const char *symname);
  72. extern int    affs_rename(struct inode *old_dir, struct dentry *old_dentry,
  73.                 struct inode *new_dir, struct dentry *new_dentry);
  74.  
  75. /* inode.c */
  76.  
  77. extern struct buffer_head    *affs_bread(kdev_t dev, int block, int size);
  78. extern void             affs_brelse(struct buffer_head *buf);
  79. extern unsigned long         affs_parent_ino(struct inode *dir);
  80. extern struct inode        *affs_new_inode(const struct inode *dir);
  81. extern int             affs_notify_change(struct dentry *dentry, struct iattr *attr);
  82. extern int             affs_add_entry(struct inode *dir, struct inode *link,
  83.                       struct inode *inode, struct dentry *dentry, s32 type);
  84. extern void             affs_put_inode(struct inode *inode);
  85. extern void             affs_delete_inode(struct inode *inode);
  86. extern void             affs_read_inode(struct inode *inode);
  87. extern void             affs_write_inode(struct inode *inode);
  88.  
  89. /* super.c */
  90.  
  91. extern int             affs_fs(void);
  92. extern int             init_affs_fs(void);
  93.  
  94. /* file.c */
  95.  
  96. void        affs_free_prealloc(struct inode *inode);
  97. extern void    affs_truncate(struct inode *);
  98.  
  99. /* dir.c */
  100.  
  101. extern void   affs_dir_truncate(struct inode *);
  102.  
  103. /* jump tables */
  104.  
  105. extern struct inode_operations     affs_file_inode_operations;
  106. extern struct inode_operations     affs_file_inode_operations_ofs;
  107. extern struct inode_operations     affs_dir_inode_operations;
  108. extern struct inode_operations     affs_symlink_inode_operations;
  109. extern struct inode_operations     affs_chrdev_inode_operations;
  110. extern struct inode_operations     affs_blkdev_inode_operations;
  111.  
  112. extern struct dentry_operations     affs_dentry_operations;
  113. extern struct dentry_operations     affs_dentry_operations_intl;
  114.  
  115. #endif
  116.